const joi = require('joi')

// title: 'tttt',
// cate_id: '',
// content: '<p>ccccccccccccccc</p>',
// state: '已发布'

const title = joi.string().alphanum().min(3).required()
const cate_id = joi.number().integer().min(1)
const content = joi.string().required().allow('')
const state = joi.string().valid('已发布', '草稿').required()

exports.add_article_schema = {
    // 对 post的请求体进行校验
    body: {
        title,
        // cate_id,
        content,
        state,
    }
}